package com.example.serverdemo.utils.sessionutils.session;

import cn.hutool.core.date.DateTime;

import java.util.concurrent.ConcurrentHashMap;

public class DeviceCommunicationSession {
    private String id;
    private long registTime;
    private ConcurrentHashMap<String,Object> attrubutes = new ConcurrentHashMap<>();
    public DeviceCommunicationSession(String id){
        this.id = id;
        this.registTime = DateTime.now().getTime();
    }
    public Object getAttribute(String name){
        return this.attrubutes.get(name);
    }
    public void addAttribute(String name,Object value){
        this.attrubutes.put(name,value);
    }
    public String getId(){
        return this.id;
    }
    public long getRegistTime(){
        return this.registTime;
    }
}
